package com.bianmaba.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;

/**
 * @program: gbk_test
 * @description:
 * @author: Chenjiabin
 * @create: 2019/5/7 14:27
 **/
@Service
public class TestService {
    @Autowired
    private ThreadPoolTaskExecutor executor;

    @Async("asyncServiceExecutor")
    public void submit() {
        try {
            int xxx = executor.getPoolSize();
            System.out.println(xxx);
            Thread.sleep(10000);
            System.out.println("run........");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
